<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <input type="button" onclick="Add()">
    <ul>
        <li>123</li>
        <li>456</li>
        <li>789</li>
    </ul>
<script src="jquery-3.5.0.js"></script>
<script>

  /*
    //文档加载绑定
    $(function () {
        $('li').click(function () {
            alert($(this).text())
        })
    });
   */
    //延迟绑定
       $(function () {
        $('ul').delegate('li','click',function () {
            alert($(this).text())
        })
    });
       
    function Add() {
        var tag = document.createElement('li');
        tag.innerText = '666';
        $('ul').append(tag)
    }
</script>
</body>
</html>